<?php


$id = $_GET['id'];
$id = intval($id);

require_once 'db_conn.php';
$sql = "select * from t_message WHERE id=$id limit 1";

$result = $conn->query($sql);
$data = array();
if($result->num_rows > 0 ){
    $rows = $result->fetch_all(MYSQLI_ASSOC);
    $data['status'] = 1;
    $data['info'] = $rows[0];
}  else {
    $data['status'] = 0;
    $data['info'] = "no information";
}
echo json_encode($data);